<!DOCTYPE HTML>
<html lang="en">
<head>
  <meta name="copyright" content=
  "Copyright (c) IBM Corporation and others 2000, 2009. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.">
  <meta charset="utf-8">
  <link rel="STYLESHEET" href="../book.css" type="text/css">
  <title>Using the Ant View</title>
</head>
<body>
  <h1>Using the Ant View</h1>
  <p>Eclipse provides a standard view, the <b><a href="../reference/ref-antview.htm">Ant view</a></b>, that lets you
  work with your Ant buildfiles. This view is tree-structured, showing Ant buildfiles as top-level entries and targets
  &amp; internal targets as children. The main advantage of this view is that you can work with all of your Ant
  buildfiles in one place, as opposed to hunting them down in one of the navigation views.</p>
  <ol>
    <li>Open the <b><a href="../reference/ref-antview.htm">Ant view</a></b> from the workbench menu by selecting
    <b>Window &gt; Show View &gt; Ant</b>.</li>
    <li>By default, the Ant view is empty. There are three ways to add Ant buildfiles to this view:
      <ul>
        <li>Click <strong>Add Buildfile [<img src="../images/add_co.svg" alt="Add buildfile to Ant view" border=
        "0">]</strong>. This brings up a dialog in which you explicitly select those Ant buildfiles you want to
        add</li>
        <li>Click <strong>Add Buildfiles with Search [<img src="../images/search.svg" alt=
        "Add buildfiles with search">]</strong>. This brings up a search dialog in which you can specify a filename
        pattern for your Ant buildfiles and search within the entire workspace or a specified working set.<br></li>
        <li>Drag and drop buildfiles from other views to the <b><a href="../reference/ref-antview.htm">Ant
        view</a></b>.<br>
        <br>
        Once added to the Ant view, Ant buildfile entries remain in the view across workbench invocations until
        explicitly removed or the associated project is closed.</li>
      </ul>
    </li>
    <li>Click <strong>Add Buildfiles with Search</strong>. Suppose you only remember that the buildfile you want to
    work with starts with <code>H</code>. Enter <code>H*.xml</code> for the buildfile name. Make sure <b>Workspace</b>
    is selected for the scope, then click <b>Search</b>. The <code>HelloWorld.xml</code> file is found and placed in
    the <b><a href="../reference/ref-antview.htm">Ant view</a></b>.</li>
    <li>Expand the top-level entry to see the default target <code>Hello</code>, and the internal target
    <code>World</code>.</li>
    <li>Select the <code>World</code> internal target and click <strong>Run the Selected Target [<img src=
    "../images/run_exc.svg" alt="Run selected buildfile or selected target">]</strong>. Notice that just the
    <code>World</code> target gets executed.</li>
    <li>Select the top-level <code>HelloWorld</code> buildfile and click <strong>Run the Default Target of the Selected
    Buildfile [<img src="../images/run_exc.svg" alt="Run selected buildfile or selected target">]</strong>. Notice that
    just the default target, <code>Hello</code>, gets executed.</li>
    <li>To edit your buildfile, bring up the context menu on the <code>HelloWorld</code> file and select <b>Open With
    &gt; Ant Editor</b>.</li>
    <li>To edit the default launch configuration, select <strong>Run As &gt; Ant Build...</strong> from the context
    menu.</li>
    <li>The Run Ant launch configuration dialog appears. Here you can modify the way in which the buildfile is run from
    the <b><a href="../reference/ref-antview.htm">Ant view</a></b>.</li>
    <li>Select the <code>HelloWorld</code> file, then click the <b>Remove</b> button. The buildfile is removed from the
    view.<br>
    <strong>Note</strong>: This does not delete the file from the workspace.</li>
  </ol>
  <h3 class="related">Related Tasks</h3><a href="qs-82_create.htm">Creating Ant buildfiles</a><br>
  <a href="qs-83_edit.htm">Editing Ant buildfiles</a><br>
  <a href="qs-85_ant_configs.htm">Saving &amp; Reusing Ant options</a><br>
  <a href="qs-84_run_ant.htm">Running Ant buildfiles</a><br>
  <a href="qs-93_project_builder.htm">Creating a project builder Ant buildfile</a><br>
  <a href="qs-92_project_builders.htm">Ant buildfiles as project builders</a><br>
  <a href="qs-94_run_pj.htm">Executing project builders</a><br>
  <a href="qs-95_external_tools.htm">External tools</a><br>
  <a href="qs-96_non_ant_pjs.htm">Non-Ant project builders</a><br>
  <a href="qs-97_standalone_ets.htm">Stand-alone external tools</a>
</body>
</html>
